<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" href="../../static/common/layui/css/layui.css">
    <link rel="stylesheet" href="../../static/css/global.css">
    <link rel="stylesheet" href="../../static/css/table.css">
    <script src="../../static/common/axios.min.js"></script>
    <script src="../../static/common/vue.min.js"></script>
    <script src="../../static/common/layui/layui.js"></script>
    <script src="../../static/js/admin/employment.js"></script>

</head>
<body>

<div style="margin: 15px;"  id="Vue" v-cloak>

    <div v-show="show">
        <form action="" method="post" class="layui-form">
            <blockquote class="layui-elem-quote">
                <div class="layui-form-item">
                    <div class="layui-input-inline">
                        <select id="department" name="department" class="layui-input" lay-filter="department" style="width: 150px;" lay-search>
                            <option value="">选择系</option>
                        </select>
                    </div>
                    <div class="layui-input-inline">
                        <select id="major" name="major" class="layui-input" lay-filter="major" style="width: 150px;" lay-search>
                            <option value="">选择专业</option>
                        </select>
                    </div>
                    <div class="layui-input-inline">
                        <select id="clazz" name="clazz" class="layui-input" lay-filter="clazz" style="width: 150px;" lay-search>
                            <option value="">选择班级</option>
                        </select>
                    </div>
                    <div class="layui-input-inline">
                        <select id="isEmployed" class="layui-select" lay-filter="isEmployed" style="width: 150px;" lay-search>
                            <option value="">是否就业</option>
                            <option value="1">待业</option>
                            <option value="2">已就业</option>
                        </select>
                    </div>
                    <input type="button" class="layui-btn" value="筛选" @click="select">
                    <input type="reset" class="layui-btn" value="重置" @click="reset">
                </div>
            </blockquote>
        </form>
        <fieldset class="layui-elem-field">
            <legend>就业信息</legend>
            <div class="layui-field-box layui-form">
                <table class="layui-table admin-table">
                    <thead>
                    <tr>
                        <th>姓名</th>
                        <th>专业</th>
                        <th>班级</th>
                        <th>目前就业单位</th>
                        <th>就业情况</th>
                        <th>详情</th>
                    </tr>
                    </thead>
                    <%--内容容器--%>
                    <tbody id="content">
                    </tbody>
                </table>
            </div>
        </fieldset>

        <%--分页容器--%>
        <div class="admin-table-page">
            <div id="paged" class="page">
            </div>
        </div>
    </div>

</div>

<!--模板-->
<script type="text/html" id="tpl">
    {{# layui.each(d.data, function(index, item){ }}
    <tr>
        <td>{{ item.studentInfoDetail.user.realname|| "-" }}</td>
        <td>
            {{# if(item.studentInfoDetail.major!=null){ }}
            {{ item.studentInfoDetail.major.name || "-" }}
            {{# }; }}
        </td>
        <td>
            {{# if(item.studentInfoDetail.clazz!=null){ }}
            {{ item.studentInfoDetail.clazz.name || "-" }}
            {{# }; }}
        </td>
        <td>
            {{# if(item.orgInfo!=null){ }}
            {{ item.orgInfo.fullname || "-"}}
            {{# }; }}
        </td>
        {{# if(item.studentInfoDetail.studentInfo.employed == 2){ }}
        <td style="color: #0e947a">已就业</td>
        {{# }; }}
        {{# if(item.studentInfoDetail.studentInfo.employed != 2){ }}
        <td style="color: red">待业</td>
        {{# }; }}
        <td> <a href="/admin/emploDetail?id={{item.studentInfoDetail.user.id}}" target="_self" data-opt="more" class="layui-btn layui-btn-normal layui-btn-mini">详情</a>
    </tr>
    {{# }); }}
</script>
<script>
    var  publisherid = ${sessionScope.currentUser.getId()};
    var admin = {};
    axios.get('/magfacultyinfo/findOne/'+publisherid)
        .then(function (response) {
//            console.log(response.data);
            admin = response.data.data.magFacultyInfo;
//            console.log(admin);
        })
        .catch(function (msg) {
            console.log(msg);
        })
</script>
</body>
</html>
